/**
 * 畏牌协议：自家显示1张字牌，2张背牌；其余三家显示3张背牌;并显示畏ico。。。。
 * 这里跟起手杠的代码应该是差不多的
 * @param who_uid      畏牌者
 * @param card_number  畏了个什么吊牌
 */
function draw_play_weipai( who_uid , card_number ){
    var xiaopai_name = "";
    PL_Room_Play.removeChild( PL_Room_Play.MOPAI_YANGAI );
    //如果是自家操作(自家操作为缩小摸牌，其他家操作为直接消失)
    if( who_uid == PB_USER_UID ){
        PL_Room_Play.MOPAI_BG2.setScale(0.2);
        PL_Room_Play.MOPAI_BG.setScale(0.2);
        //生产3张（其中1张是明牌的墩，移动到本方的下牌区域）
        //删除手牌中存在的这2张畏牌
        for( var i = 0 ; i <= 1 ; i++ ) {
            for (var y = 1; y < PL_Room_Play.PPP_pai.length; y++) {
                if (PL_Room_Play.PPP_pai[y].paihao == card_number) {
                    PL_Room_Play.removeChild(PL_Room_Play.PPP_pai[y]);
                    DUN_PS[(PL_Room_Play.PPP_pai[y].dijidun - 1)]--;//牌墩上的牌数-1
                    PL_Room_Play.PPP_pai.splice(y, 1);
                    break;
                }
            }
        }
        //移动3张背景牌 + 1张号码牌
        for( var i = 0 ; i <= 2 ; i++ ){
            //小牌移动
            if( i <= 1 ){
                var temp     = cc.Sprite.create('res/cd_huxiBG.png');
            }else{
                xiaopai_name = card_number <= 10 ? 'ss' + card_number : 's' + (card_number-10);
                var temp     = cc.Sprite.create('res/pai/xp/' + xiaopai_name + '.png');
            }
            temp.x           = PL_Room_Play.realy_size.width / 2;
            temp.y           = PL_Room_Play.realy_size.height / 2;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.3 , cc.p(  40 * ZJ_XP_COUNT , 42*(i) - 500 + LB_XP_HEIGHT ) ) );
            //将畏牌记录
            temp.card_number = card_number;
            WEI_PAI_ZJ.push( temp );
            MISCE.push( temp );//添加杂项
        }
        ZJ_XP_COUNT++;
        //清除摸牌
        PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG);PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG2);
        //理牌
        draw_play_paireset();
    }else {
        PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG);PL_Room_Play.removeChild(PL_Room_Play.MOPAI_BG2);
    }
    //如果是下家畏牌
    if( who_uid == ROOM_WS_XJ ){
        //移动3张背景牌
        for( var i = 0 ; i <= 2 ; i++ ){
            var temp     = cc.Sprite.create('res/cd_huxiBG.png');
            temp.x       = PL_Room_Play.realy_size.width - 400;temp.y       = PL_Room_Play.realy_size.height / 2;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  PL_Room_Play.realy_size.width -  40 * XJ_XP_COUNT , 42 * i + RB_XP_HEIGHT ) ) );
            //将畏牌记录
            temp.card_number = card_number;
            WEI_PAI_XJ.push( temp );
            MISCE.push( temp );//添加杂项
        }
        XJ_XP_COUNT++;
    }
    //如果是上家畏牌
    if( who_uid == ROOM_WS_SJ ){
        //移动3张背景牌
        for( var i = 0 ; i <= 2 ; i++ ){
            var temp     = cc.Sprite.create('res/cd_huxiBG.png');
            temp.x       = 400;temp.y       = PL_Room_Play.realy_size.height - 400;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  40 * SJ_XP_COUNT , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  42 * i ) ) );
            //将畏牌记录
            temp.card_number = card_number;
            WEI_PAI_SJ.push( temp );
            MISCE.push( temp );//添加杂项
        }
        SJ_XP_COUNT++;
    }
    //如果是对家畏牌
    if( who_uid == ROOM_WS_DM ){
        //移动3张背景牌
        for( var i = 0 ; i <= 2 ; i++ ){
            var temp     = cc.Sprite.create('res/cd_huxiBG.png');
            temp.x       = PL_Room_Play.realy_size.width - 400;temp.y       = PL_Room_Play.realy_size.height - 400;
            PL_Room_Play.addChild( temp );
            temp.runAction( cc.MoveTo.create( 0.2 , cc.p(  PL_Room_Play.realy_size.width -  40 * DM_XP_COUNT , PL_Room_Play.realy_size.height - TOP_LEFT_XP_HEIGHT -  42 *i ) ) );
            //将畏牌记录
            temp.card_number = card_number;
            WEI_PAI_DM.push( temp );
            MISCE.push( temp );//添加杂项
        }
        DM_XP_COUNT++;
    }
    //进行trip操作
    show_tripAND_sound( 'wei' , who_uid );
}